import { loginAPI } from '@/api/user'
export default {
  namespaced: true,
  state: {
    token: ''
  },
  mutations: {
    setToken(state, token) {
      state.token = token
    },
    removeToken(state) {
      state.token = ''
    }
  },
  actions: {
    async loginAction({ commit }, data) {
      const res = await loginAPI(data)
      console.log(res)
      commit('setToken', data)
    }
  }

}
